package com.yimi.yinhepda.db.dao;

import com.j256.ormlite.stmt.QueryBuilder;
import com.j256.ormlite.stmt.Where;
import com.yimi.yinhepda.base.BaseApplication;
import com.yimi.yinhepda.db.helper.DbHelper;
import com.yimi.yinhepda.db.table.UnloadUcTaskNoTable;

import java.sql.SQLException;
import java.util.List;

/**
 * @author: lj
 * Date: 2019/10/13 11:11
 * Description:卸车uc快递任务表数据库操作类
 */
public class UnloadUcTaskNoTableDao extends BaseDao<UnloadUcTaskNoTable, Long> {

    public UnloadUcTaskNoTableDao() {
        super(DbHelper.getInstance(BaseApplication.getContext()), UnloadUcTaskNoTable.class);
    }

    public List<UnloadUcTaskNoTable> getUcTaskNos(String task) {
        try {
            QueryBuilder<UnloadUcTaskNoTable, Long> queryBuilder = dao.queryBuilder();
            Where where = queryBuilder.where();
            where.eq("task", task);
            return queryBuilder.query();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
